{
 "metadata": {
  "signature": "sha256:a43b8ccabff4fbb0e1f18a7067db998e4a2bfa7df8723557be4dacfdf91e3f5f"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Matplotlib: bar charts\n",
      "======================================================================\n",
      "\n",
      "Use the bar function to make bar charts:\n",
      "<http://matplotlib.sourceforge.net/matplotlib.pylab.html>\\#-bar\n",
      "\n",
      "Here's an example script that makes a bar char with error bars and\n",
      "labels centered under the bars."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#!/usr/bin/env python\n",
      "import numpy as na\n",
      "\n",
      "from matplotlib.pyplot import *\n",
      "\n",
      "labels = [\"Baseline\", \"System\"]\n",
      "data =   [3.75               , 4.75]\n",
      "error =  [0.3497             , 0.3108]\n",
      "\n",
      "xlocations = na.array(range(len(data)))+0.5\n",
      "width = 0.5\n",
      "bar(xlocations, data, yerr=error, width=width)\n",
      "yticks(range(0, 8))\n",
      "xticks(xlocations+ width/2, labels)\n",
      "xlim(0, xlocations[-1]+width*2)\n",
      "title(\"Average Ratings on the Training Set\")\n",
      "gca().get_xaxis().tick_bottom()\n",
      "gca().get_yaxis().tick_left()\n",
      "\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAVoAAAEHCAYAAADvQY5fAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAEp5JREFUeJzt3XmwZGV9xvHvAyODbOKCCLJpENkXQQU1qVaDRnBfylIS\ngSiKojHucUGuSAArYtREsTBojJboxBUU9zCglJYLW1SMBOKaIjK4KwIjv/xxzh2ay116mPvevnPv\n91N1a06frX+n+z1Pv+ft7ulUFZKkdjYZdwGStNQZtJLUmEErSY0ZtJLUmEErSY0ZtJLUmEGrZSfJ\nIUmOH3cdWj4M2o1I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